<?php

require_once('utils.php');
function get_access_token($appid,$appkey,$request_token,$request_token_secret,$vericode)
{
$url    = 'http://openapi.qzone.qq.com/oauth/qzoneoauth_access_token?';
$sigstr = 'GET'.'&'.rawurlencode('http://openapi.qzone.qq.com/oauth/qzoneoauth_access_token').'&';
$params = array();
$params['oauth_version']          = '1.0';
$params['oauth_signature_method'] = 'HMAC-SHA1';
$params['oauth_timestamp']        = time();
$params['oauth_nonce']            = mt_rand();
$params['oauth_consumer_key']     = $appid;
$params['oauth_token']            = $request_token;
$params['oauth_vericode']         = $vericode;
$normalized_str = get_normalized_string($params);
$sigstr        .= rawurlencode($normalized_str);
$key = $appkey.'&'.$request_token_secret;
$signature = get_signature($sigstr,$key);
$url      .= $normalized_str.'&'.'oauth_signature='.rawurlencode($signature);
return file_get_contents($url);
}
function get_qquser_info($appid,$appkey,$access_token,$access_token_secret,$openid)
{
$url    = 'http://openapi.qzone.qq.com/user/get_user_info';
$info   = do_get($url,$appid,$appkey,$access_token,$access_token_secret,$openid);
$arr = array();
$arr = json_decode($info,true);
return $arr;
}
?>